package com.cn.wanxi.servlet.manage.product;

import com.cn.wanxi.model.ResultModel;
import com.cn.wanxi.service.ICuisineService;
import com.cn.wanxi.service.IProductService;
import com.cn.wanxi.service.impl.CuisineServiceImpl;
import com.cn.wanxi.service.impl.ProductServiceImpl;
import net.sf.json.JSONArray;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/backProductCuisineFindAll")
public class CuisineFindAllServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ICuisineService iCuisineService = new CuisineServiceImpl();
        ResultModel resultModel = iCuisineService.findAll();
        JSONArray jsonArray = JSONArray.fromObject(resultModel);
        resp.getWriter().println(jsonArray);
    }
}
